| Conditions | 1 | 
| Paths | 1 | 
| Total Lines | 40 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | "use strict"; | ||
| 18 | let createWindow = () => { | ||
| 19 | // Create the browser window. | ||
| 20 |     mainWindow = new BrowserWindow({ | ||
| 21 | width: 800, | ||
| 22 | height: 600 | ||
| 23 | }); | ||
| 24 | |||
| 25 | mainWindow.maximize(); | ||
| 26 | |||
| 27 | |||
| 28 |     // mainWindow.webContents.loadURL('http://example.com'); | ||
| 29 | |||
| 30 | // and load the index.html of the app. | ||
| 31 |     mainWindow.loadURL(url.format({ | ||
| 32 | pathname: path.join(__dirname, '../views/index.html'), | ||
| 33 | protocol: 'file:', | ||
| 34 | slashes: true | ||
| 35 | })); | ||
| 36 | |||
| 37 |     mainWindow.webContents.on('new-window', (event, url) => { | ||
| 38 | event.preventDefault(); | ||
| 39 | open(url); | ||
| 40 | }); | ||
| 41 | |||
| 42 | // Open the DevTools. | ||
| 43 | mainWindow.webContents.openDevTools(); | ||
| 44 | |||
| 45 | touchbar.setMainWindow(mainWindow); | ||
| 46 | mainWindow.setTouchBar(touchbar.touchBar); | ||
| 47 | // | ||
| 48 | |||
| 49 | |||
| 50 | // Emitted when the window is closed. | ||
| 51 |     mainWindow.on('closed', () => { | ||
| 52 | // Dereference the window object, usually you would store windows | ||
| 53 | // in an array if your app supports multi windows, this is the time | ||
| 54 | // when you should delete the corresponding element. | ||
| 55 | mainWindow = null; | ||
| 56 | }); | ||
| 57 | }; | ||
| 58 | |||
| 62 |